/*
 * Copyright (C) 2017 yixun All Rights Reserved.
 *
 * CommissionDto.java
 */
package com.yixun.qfbao.model.dto;

import com.yixun.qfbao.model.ReportCommission;

import java.math.BigDecimal;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;

/**
 * [文件名称]<br>
 * CommissionDto.java<br>
 * <br>
 * [文件描述]<br>
 * 数据辅助类<br>
 * <br>
 * [修改记录]<br>
 * 2017-10-26 15:35:03 创建 陶俊代码生成器<br>
 *
 * @author 陶俊代码生成器
 * @version 1.00
 */
public class CustomerPremisesCommissionDto extends ReportCommission {
    private static final long serialVersionUID = 1L;
    /**
     * 需要正序字段名
     */
    private List<String> asc;
    /**
     * 需要逆序字段名
     */
    private List<String> desc;
    /**
     * 排序SQL
     */
    private String orders;
    /*********
     * 扩展字段
     * *******
     */
    /**
     * 合作机构名称
     */
    private String companyName;
    /**
     * 楼盘名称
     */
    private String premisesName;

    /**
     * 房间号
     */
    private String roomName;
    /**
     * 客户姓名
     */
    private String customerName;
    /**
     * 客户电话
     */
    private String mobile;
    /**
     * 计价面积
     */
    private String valuationArea;
    /**
     * 成交金额
     */
    private BigDecimal dealAmount;
    /**
     * 认购日期
     */
    private Date subscribeTime;
    /**
     * 签约日期
     */
    private Date signTime;
    /**
     * 经纪人姓名
     */
    private String staffName;
    /**
     * 经纪人手机号
     */
    private String staffPhone;

    /**
     * 结佣方式
     */
    private String commissionWay;

    /**
     * 结佣方式名称
     */
    private String commissionWayName;
    /**
     * 实际结佣日期
     */
    private String actualDateStr;
    /**
     * 控制结算佣金按钮显示（1-显示，0-隐藏）
     */
    private String pendingBtn;
    /**
     * 扩展sql
     */
    private String sql;

    public String getSql() {
        return sql;
    }

    public void setSql(String sql) {
        this.sql = sql;
    }

    /**
     * 结佣操作人的姓名
     */
    private String settmentUserName;

    public String getSettmentUserName() {
        return settmentUserName;
    }

    public void setSettmentUserName(String settmentUserName) {
        this.settmentUserName = settmentUserName;
    }

    public String getPendingBtn() {
        return pendingBtn;
    }

    public void setPendingBtn(String pendingBtn) {
        this.pendingBtn = pendingBtn;
    }


    public String getActualDateStr() {
        return actualDateStr;
    }

    public void setActualDateStr(String actualDateStr) {
        this.actualDateStr = actualDateStr;
    }


    public String getPremisesName() {
        return premisesName;
    }

    public void setPremisesName(String premisesName) {
        this.premisesName = premisesName;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getRoomName() {
        return roomName;
    }

    public void setRoomName(String roomName) {
        this.roomName = roomName;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getValuationArea() {
        return valuationArea;
    }

    public void setValuationArea(String valuationArea) {
        this.valuationArea = valuationArea;
    }

    public BigDecimal getDealAmount() {
        return dealAmount;
    }

    public void setDealAmount(BigDecimal dealAmount) {
        this.dealAmount = dealAmount;
    }

    public Date getSubscribeTime() {
        return subscribeTime;
    }

    public void setSubscribeTime(Date subscribeTime) {
        this.subscribeTime = subscribeTime;
    }

    public Date getSignTime() {
        return signTime;
    }

    public void setSignTime(Date signTime) {
        this.signTime = signTime;
    }

    public String getStaffName() {
        return staffName;
    }

    public void setStaffName(String staffName) {
        this.staffName = staffName;
    }

    public String getStaffPhone() {
        return staffPhone;
    }

    public void setStaffPhone(String staffPhone) {
        this.staffPhone = staffPhone;
    }

    public String getCommissionWay() {
        return commissionWay;
    }

    public void setCommissionWay(String commissionWay) {
        this.commissionWay = commissionWay;
    }

    public String getCommissionWayName() {
        return commissionWayName;
    }

    public void setCommissionWayName(String commissionWayName) {
        this.commissionWayName = commissionWayName;
    }

    /**
     * 添加需要正序字段名
     */
    public void addAsc(String col) {
        if (asc == null) {
            asc = new LinkedList<String>();
        }
        asc.add(col);
    }

    /**
     * 清空需要正序字段名
     */
    public void cleanAsc() {
        asc = null;
    }

    /**
     * 添加需要逆序字段名
     */
    public void addDesc(String col) {
        if (desc == null) {
            desc = new LinkedList<String>();
        }
        desc.add(col);
    }

    /**
     * 清空需要逆序字段名
     */
    public void cleanDesc() {
        desc = null;
    }

    /**
     * 如果排序SQL为空根据需要正逆序的字段名拼接排序SQL
     */
    public String getOrders() {
        StringBuilder orderStr = null;
        StringBuilder ascStr;
        StringBuilder descStr;
        if (orders == null) {
            if (asc != null) {
                ascStr = new StringBuilder();
                orderStr = new StringBuilder();
                String pex = "";
                for (String a : asc) {
                    ascStr.append(pex + a);
                    pex = ",";
                }
                orderStr.append(ascStr.toString() + " ASC");
            }
            if (desc != null) {
                descStr = new StringBuilder();
                String pex = "";
                for (String d : desc) {
                    descStr.append(pex + d);
                    pex = ",";
                }
                if (orderStr == null) {
                    orderStr = new StringBuilder();
                    orderStr.append(descStr.toString() + " DESC");
                } else {
                    orderStr.append("," + descStr.toString() + " DESC");
                }
            }
            orders = orderStr != null ? orderStr.toString() : null;
        }

        return orders;
    }

    /**
     * 设置排序SQL
     */
    public void setOrders(String orders) {
        this.orders = orders;
    }

    private Date actualDateBefore;
    private Date actualDateAfter;
    private Date updateTimeBefore;
    private Date updateTimeAfter;
    private Date pendingDateBefore;
    private Date pendingDateAfter;
    private Date createTimeBefore;
    private Date createTimeAfter;

    private List<Long> agencyDeptIds;

    public Date getActualDateBefore() {
        return this.actualDateBefore;
    }

    public void setActualDateBefore(Date actualDateBefore) {
        this.actualDateBefore = actualDateBefore;
    }

    public Date getActualDateAfter() {
        return this.actualDateAfter;
    }

    public void setActualDateAfter(Date actualDateAfter) {
        this.actualDateAfter = actualDateAfter;
    }

    public Date getUpdateTimeBefore() {
        return this.updateTimeBefore;
    }

    public void setUpdateTimeBefore(Date updateTimeBefore) {
        this.updateTimeBefore = updateTimeBefore;
    }

    public Date getUpdateTimeAfter() {
        return this.updateTimeAfter;
    }

    public void setUpdateTimeAfter(Date updateTimeAfter) {
        this.updateTimeAfter = updateTimeAfter;
    }

    public Date getPendingDateBefore() {
        return this.pendingDateBefore;
    }

    public void setPendingDateBefore(Date pendingDateBefore) {
        this.pendingDateBefore = pendingDateBefore;
    }

    public Date getPendingDateAfter() {
        return this.pendingDateAfter;
    }

    public void setPendingDateAfter(Date pendingDateAfter) {
        this.pendingDateAfter = pendingDateAfter;
    }

    public Date getCreateTimeBefore() {
        return this.createTimeBefore;
    }

    public void setCreateTimeBefore(Date createTimeBefore) {
        this.createTimeBefore = createTimeBefore;
    }

    public Date getCreateTimeAfter() {
        return this.createTimeAfter;
    }

    public void setCreateTimeAfter(Date createTimeAfter) {
        this.createTimeAfter = createTimeAfter;
    }

    public List<Long> getAgencyDeptIds() {
        return agencyDeptIds;
    }

    public void setAgencyDeptIds(List<Long> agencyDeptIds) {
        this.agencyDeptIds = agencyDeptIds;
    }
}
